#pragma once
#include "widget.h"
#include "Container.h"
#define INVALID_VIEW_INDEX 0xFFFFFFFF
class DLL_EXP CViewContainer : public CContainerWidget,public CUIViewInterface
{
private:
	unsigned int m_nViewIndex;
public:
	CViewContainer();
	virtual ~CViewContainer();
	virtual void OnInitialUpdate();
	virtual void OnViewSwitchOut();
	virtual void OnViewSwitchIn();
	virtual void SetViewIndex(unsigned int index);
	virtual unsigned int GetViewIndex();
protected:
};

class DLL_EXP CViewManager{
public:
	CViewManager(CContainerWidget* pContainer);
	virtual ~CViewManager();
	CContainerWidget* m_pContainer;
	CViewContainer* m_pCurActiveView;
	CObjList m_viewList;
	bool AddView(CViewContainer* pView,unsigned int viewIndex);
	bool RemoveView(CViewContainer* pView);
	bool RemoveView(unsigned int viewIndex);	
	bool SwitchView(CViewContainer* pView);
	bool SwitchView(unsigned int viewIndex);
	unsigned int GetActiveViewIndex();
	CViewContainer* GetActiveView();

	
};